<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Menu extends BaseModel
{
    use HasFactory;
    protected $table = "menu";

    /**
     * 获取上级菜单
     */
    public function parent(){
        return $this->hasOne(Menu::class,'id','pid');
    }

}
